﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFile>
#include <QStringList>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    int customDialog(const QStringList &, const QString &text, const QString &title = "警告");

    void setSignupname(const QString &newSignupname);
    void setSignpasswd(const QString &newSignpasswd);

    void setSignupquestion(const QString &newSignupquestion);

    const QFile &getFile() const;

    void write();
    void setTobehandle(bool newTobehandle);
    bool filecontains(const QString &arg);


private slots:
    void on_pushButton_sign_in_clicked();


    void on_pushButton_sign_up_clicked();

    void on_pushButton_findpasswd_clicked();

private:
    Ui::MainWindow *ui;
    QFile file;//用户信息文件
    QString signupname;
    QString signpasswd;
    QString signupquestion;
    bool tobehandle;//是否有待处理的用户注册信息
};
#endif // MAINWINDOW_H
